//
//  DBYPhotoCollectionViewCell.m
//  MemoryTravel
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 fcx. All rights reserved.
//

#import "DBYPhotoCollectionViewCell.h"

@implementation DBYPhotoCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [self.contentView addSubview:self.photoImageView];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    // 大图片
    self.photoImageView.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.height);
//    [self.photoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
//        
//        make.left.and.top.mas_equalTo(0);
//        make.size.mas_equalTo(CGSizeMake(self.contentView.bounds.size.width, self.contentView.bounds.size.height));
//    }];
}
-(void)setPhoto:(DBYPhotoModel *)photo
{
    if (_photo != photo) {
        _photo = photo;
    }
    [self.photoImageView sd_setImageWithURL:[NSURL URLWithString:self.photo.image_url] placeholderImage:[UIImage imageNamed:@"loading.jpg"]];

    
}
@end
